#ifndef GAMESCENE_H
#define GAMESCENE_H

#include <QWidget>
#include <QObject>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGLWidget>
#include <QGLFormat>

#include "graphicspanview.h"

// This class is designed to be inherited by a class representing
// a scene in the game.

class GameScene : public QWidget
{
    Q_OBJECT

public:
    GameScene(QWidget *parent = 0);

    enum GameScenes {endGame = -1,      // These represent the scenes in the game
                     menuScene = 0,     // There are here so they can be reurned by end()
                     helpScene = 1,     // so the games knows the next scene to play. -1 is
                     levelScene = 2};   // always end game.

    GraphicsPanView * mainView;

    void pauseScene();
    void resumeScene();

public slots:
    void startScene();     //Starts the timer to update the scene. Call this
                           //function when the scene starts.

    void endScene(GameScene::GameScenes nextScene);    // Stops the scene updats and hides the graphics
                                                       // view. Call this function when the scene is over.

signals:
    void end(GameScene::GameScenes nextScene);


protected:
    virtual void start();   //Reimpliment this to run code when the scene is started
    void timerEvent(QTimerEvent *event);
    

    QGraphicsScene * mainScene;
    QGLWidget * GLWidget;

private:
    int updateTimerId;  // Keeps track of the timer id for the update timer so we can
                            // kill it at the end of the scene
};

#endif // GAMESCENE_H
